import { ApiProperty, PartialType } from '@nestjs/swagger';
import { IsBoolean, IsNotEmpty } from 'class-validator';
import { IndexDto, ShowDto, DeleteDto } from '@libs/common/dto';
import { AccessLog } from '../entities/access-log.entity';

export class IndexAccessLogDto extends IndexDto<AccessLog> {}

export class ShowAccessLogDto extends ShowDto {}

export class DeleteAccessLogDto extends DeleteDto {}

export class CreateAccessLogDto {}

export class UpdateAccessLogDto extends PartialType(CreateAccessLogDto) {
  @ApiProperty()
  @IsNotEmpty({ message: 'id 不能为空' })
  id: string;
}

export class FindAccessLogDto extends PartialType(UpdateAccessLogDto) {}

export class SwitchAccessLogDto {
  @ApiProperty()
  @IsNotEmpty({ message: 'id 不能为空' })
  id: string;

  @ApiProperty({ description: '状态' })
  @IsNotEmpty({ message: '状态不能为空' })
  @IsBoolean()
  status: boolean;
}

export class ImportAccessLogDto {}

export class ExportAccessLogDto {}
